package edu.cueb.wmis.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import edu.cueb.wmis.mapper.HouseMapper;
import edu.cueb.wmis.mapper.HouseShelfMapper;
import edu.cueb.wmis.pojo.House;
import edu.cueb.wmis.pojo.HouseShelf;
import edu.cueb.wmis.pojo.Shelf;
import edu.cueb.wmis.mapper.ShelfMapper;
import edu.cueb.wmis.service.IShelfService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liuzizhuo
 * @since 2021-04-19
 */
@Service
public class ShelfServiceImpl extends ServiceImpl<ShelfMapper, Shelf> implements IShelfService {

    @Autowired
    private ShelfMapper shelfMapper;

    @Override
    public List<Shelf> getShelfsByHouseId(Integer hid) {
//        HouseShelf hs = houseShelfMapper.selectOne(new QueryWrapper<HouseShelf>().eq("hid", hid));
//        List<Shelf> shelves = hs.get
        List<Shelf> shelves = shelfMapper.getShelfsByHouseId(hid);
        System.out.println(shelves);
        return shelves;
    }


}
